package org.xx.armory.swing.builders;

import org.xx.armory.objectparser.LineInfo;
import org.xx.armory.objectparser.ParsedObject;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class OptionsModel
        extends ParsedObject {
    private final String name;
    private final List<OptionModel> children;

    public OptionsModel(
            LineInfo lineInfo,
            String name,
            Collection<? extends OptionModel> children
    ) {
        super(lineInfo);

        this.name = name;
        this.children = children != null ? new ArrayList<>(children) : Collections.emptyList();
    }

    public String getName() {
        return this.name;
    }

    public List<OptionModel> getChildren() {
        return Collections.unmodifiableList(this.children);
    }
}
